/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spatialmarketplace.cem.model;

import java.util.Date;

/**
 *  Reflects the Forum Post information from the database.
 * @author Camila
 */
public class ForumPost {
    
    //Fields in Database
    private Integer idPost = 0; 
    private Integer likeCount = 0;
    private String text;
    private boolean isLiked;
    private boolean hasBeenReported;
    private boolean isReported = false;
    private Integer userId = null;
    private Integer groupOrResourceId = null;
    private boolean belongsToGroup;//Indicates true if this is a forumPost from a group, or false if it is related to a resource.
    private Date date;
    
    //Added fields for business logic
    private String userPhoto;
    private String userName;

    
    /**
     * Constructor with all the fields to retrieve the posts from the database
     * @param idPost
     * @param likeCount
     * @param text
     * @param isResported
     * @param isLiked
     * @param userId
     * @param groupOrResourceId
     * @param belongsToGroup
     * @param date
     * @param userPhoto
     * @param UserName 
     */
    public ForumPost(Integer idPost, Integer likeCount, String text, boolean isResported, boolean isLiked, Integer userId, Integer groupOrResourceId, boolean belongsToGroup, Date date, String userPhoto, String UserName) {
        this.idPost = idPost;
        this.likeCount = likeCount;
        this.text = text;
        this.hasBeenReported = isResported;
        this.isLiked = isLiked;
        this.userId = userId;
        this.groupOrResourceId = groupOrResourceId;
        this.belongsToGroup = belongsToGroup;
        this.date = date;
        this.userPhoto = userPhoto;
        this.userName = UserName;
    }

    /**
     * Default constructor to initialize all variables.
     */
    public ForumPost() {
        this.likeCount = 0;
        this.text = new String();
        this.isReported = false;
        this.isLiked = false;
        this.belongsToGroup = false;
        this.date = new Date ();
        this.userPhoto = new String ();
        this.userName = new String ();
    }


    public String getUserName() {
        return userName;
    }

    public void setUserName(String UserName) {
        this.userName = UserName;
    }

    public Integer getIdPost() {
        return idPost;
    }

    public void setIdPost(Integer idPost) {
        this.idPost = idPost;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserPictureURL() {
        return userPhoto;
    }

    public void setUserPictureURL(String userPictureURL) {
        this.userPhoto = userPictureURL;
    }

    public boolean getIsLiked() {
        return isLiked;
    }

    public void setHasBeenReported(boolean hasBeenReported) {
        this.hasBeenReported = hasBeenReported;
    }
    
    public boolean getHasBeenReported() {
        return hasBeenReported;
    }

    public void setIsLiked(boolean isLiked) {
        this.isLiked = isLiked;
    }
    
    public boolean getIsResported() {
        return isReported;
    }
    
    public boolean isIsResported() {
        return isReported;
    }

    public boolean isResported() {
        return isReported;
    }
    
    public void setIsResported(boolean isResported) {
        this.isReported = isResported;
    }

    public String getUserPhoto() {
        return userPhoto;
    }

    public void setUserPhoto(String userPhoto) {
        this.userPhoto = userPhoto;
    }

    public boolean getBelongsToGroup() {
        return belongsToGroup;
    }

    public void setBelongsToGroup(boolean belongsToGroup) {
        this.belongsToGroup = belongsToGroup;
    }

    public Integer getGroupOrResourceId() {
        return groupOrResourceId;
    }

    public void setGroupOrResourceId(Integer groupOrResourceId) {
        this.groupOrResourceId = groupOrResourceId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

}
